import { Redirect, Route } from "react-router-dom";
import { isLogined } from "../../utils/tools";

function index({ children, ...rest }) {
	return (
		<Route
			{...rest}
      render={() => (isLogined('token') ?  children  : <Redirect to="/login" />)}
		/>
	);
}
export default index;
